﻿using UIOC.Attributes;

namespace UIOC.Observable {

    /// <summary>
    /// 可观察结构箱
    /// </summary>
    /// <typeparam name="T">结构类型</typeparam>
    public interface IObservableStructBox<T> : IObservableData<T> where T : struct {
    }

    /// <summary>
    /// 结构箱
    /// </summary>
    /// <typeparam name="T">结构类型</typeparam>
    public interface IStructBox<T> : IData<T>, IObservableStructBox<T> where T : struct {
    }

    [Implement(typeof(IObservableStructBox<>))]
    [Implement(typeof(IStructBox<>))]
    public partial class StructBox<T> : Data<T>, IStructBox<T> where T : struct {

        public override string ToString() {
            return GetValue().ToString();
        }
    }
}